<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include file="check-login.asp"-->
<!--#include file="header.asp"-->
<!--#include file="sidebar.asp"-->

<%
'load settings
dbRS1.open "select * from " & db_prefix & "options",dbConn
%>

<div id="main">
	<div id="inner">
    
<h1>Configure your site</h1>
    
<form id="config_form" action="doconfig.asp" method="post">
<div class="tabber" id="aconfigtab">
	<div class="tabbertab">
      <h2>Basic Settings</h2>
      	<h4>Specify basic settings for your site.</h4>
        <label>Site name</label><br />
     	<input type="text" name="name" size="100" value="<%=Server.HTMLEncode(dbRS1("name"))%>" /><br /><br />
        <label>Root address</label><br />
     	<input type="text" name="root" size="100" value="<%=dbRS1("root")%>" /><br /><br />
        <label>Logo url</label><br />
     	<input type="text" name="logo_url" size="100" value="<%=dbRS1("logo_url")%>" /><br /><br />
        <label>Copyright text</label><br />
     	<input type="text" name="copyright" size="100" value="<%=Server.HTMLEncode(dbRS1("copyright"))%>" /><br /><br />
        <hr />
		<label>Site enabled</label><br />
     	<input type="radio" name="enabled" value="1" checked="checked" <%if dbRS1("enabled") = 1 then Response.Write "checked=""checked"""%> class="nocss" />Yes&nbsp;<input type="radio" name="enabled" value="0" <%if dbRS1("enabled") = 0 then Response.Write "checked=""checked"""%> class="nocss" />No<br /><br />
        <label>Site disabled text</label><br />
     	<input type="text" name="disabled_text" size="100" value="<%=dbRS1("disabled_text")%>" /><br /><br /> 
	 </div>
     
	<div class="tabbertab">
      <h2>Content</h2>
      	<h4>Misc site content options.</h4>
        <label>Posts per page</label><br />
     	<input type="text" name="posts_perpage" size="2" value="<%=dbRS1("posts_perpage")%>" /><br /><br />
        <label>Comments per page</label><%=FR%><br />
     	<input type="text" name="comments_perpage" size="2" value="0" disabled="disabled" value="<%=dbRS1("comments_perpage")%>" /><br /><br />
        <label>Use custom home</label><br />
     	<input type="radio" name="use_custom_home" value="1" <%if dbRS1("use_custom_home") = 1 then Response.Write "checked=""checked"""%> class="nocss" />Yes&nbsp;<input type="radio" name="use_custom_home" value="0" <%if dbRS1("use_custom_home") = 0 then Response.Write "checked=""checked"""%> class="nocss" />No<br /><br />
        <label>Badwords</label> <span class="small">(Comma separated)</span><br />
        <textarea name="badwords" cols="70" rows="5"><%=get_badwords%></textarea>
	 </div>
     
	<div class="tabbertab">
      <h2>S.E.O.</h2>
      	<h4>Options for Search Engines Optimizations.</h4>
        <label>Description</label><br />
     	<input type="text" name="description" size="100" value="<%=dbRS1("description")%>" /><br /><br />
        <label>Keywords</label><br />
     	<input type="text" name="keywords" size="100" value="<%=dbRS1("keywords")%>" /><br /><br />
        <label>Additional HTML meta tags</label><br />
     	<input type="text" name="add_meta" size="100" value="<%=Server.HTMLEncode(dbRS1("add_meta"))%>" /><br /><br />
        <label>Use nice urls</label><%=FR%><br />
     	<input type="radio" name="use_nice_urls" value="1" disabled="disabled" <%if dbRS1("use_nice_urls") = 1 then Response.Write "checked=""checked"""%> class="nocss" />Yes&nbsp;<input type="radio" name="use_nice_urls" value="0" <%if dbRS1("use_nice_urls") = 0 then Response.Write "checked=""checked"""%> class="nocss" disabled="disabled" />No<br /><br />
	 </div>

	<div class="tabbertab">
      <h2>Appearance</h2>
      	<h3>Pick a theme and custom CSS (optional)</h3>
        <label>Theme</label><br />
<table width="100%"><tr><td width="350" valign="top">
        <select style="width:300px;font-weight:bold;padding:3px;" name="theme" onchange="getElementById('theme_preview').src='/themes/'+this.options[this.selectedIndex].text+'/preview.jpg'">
<%
	
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
	Set themes = fso.GetFolder(server.MapPath("/") & "\themes\")
                    
    For Each theme In themes.SubFolders
		response.Write "<option value=""" & theme.name & """"
		if zb_theme = theme.name then response.Write " selected "
		response.Write ">" & theme.name & "</option>" & vbcrlf
	next
%>    	
        </select>
<br />
<label>Preview</label><br />
<img src="/themes/<%=zb_theme%>/preview.jpg" width="280" height="200" alt="Theme Preview" id="theme_preview" style="padding:1px;border:1px solid #c0c0c0;" />
</td><td valign="top">
<h3>Current theme info:</h3>
<%
Dim FSO
set t=FSO.OpenTextFile(Server.MapPath("/") & "\themes\" & zb_theme & "\NOTES.txt")
Response.Write "<strong>" & t.ReadLine & "</strong><br />"
do while not t.AtEndOfStream
	Response.Write t.ReadLine & "<br />"
loop
t.close
set t = nothing
set FSO = nothing
%>
</td></tr></table>        
        <br />
        <label>Custom CSS</label><br />
     	<input type="text" name="customcss" size="50" disabled="disabled" /><%=FR%><br /><br />
<!--
        	<div class="tab-pane" id="tab-pane-2">
            	<div class="tab-page">
      				<h2 class="tab">Master Page</h2>
                    <textarea cols="80" rows="10" readonly="readonly">
                    	<%'getTemplatePage("master.asp")%>
                    </textarea>
                </div>
                <div class="tab-page">
      				<h2 class="tab">Blog Post</h2>
                    <textarea cols="80" rows="10" readonly="readonly">
                    	<%'getTemplatePage("post.asp")%>
                    </textarea>
                </div>
                <div class="tab-page">
      				<h2 class="tab">Article</h2>
                    <textarea cols="80" rows="10" readonly="readonly">
                    	<%'getTemplatePage("article.asp")%>
                    </textarea>
                </div>
                <div class="tab-page">
      				<h2 class="tab">Post List</h2>
                    <textarea cols="80" rows="10" readonly="readonly">
                    	<%'getTemplatePage("post-list.asp")%>
                    </textarea>
                </div>
                <div class="tab-page">
      				<h2 class="tab">Comments</h2>
                    <textarea cols="80" rows="10" readonly="readonly">
                    	<%=getTemplatePage("comment.asp")%>
                    </textarea>
                </div>
            </div>
-->
            <span class="small">You will be able to edit template pages here in the final release. Right now you can find and edit each page in the template's folder in your server (/themes/theme-name/*.asp). You can also download new themes at <a href="http://www.unwrittenblog.com">UnwrittenBlog.com</a></span><br /><br />
           </div>
           
	<div class="tabbertab">
      <h2>Podcast</h2>
      	<h3>Configure your podcast for iTunes<%=FR%></h3>
        <p>
        	<font color="#660000">Podcasting support will be available in the final release.</font>
        </p>
     </div>
	</div>
<div class="form_buttons"><input type="submit" value="Save all settings" class="form_button" tabindex="3" /></div>
</form>
<!-- /main inner --></div><!-- /main --></div>

<%
dbRS1.close
%>
<!--#include file="footer.asp"-->